package com.regan.erp.aop;

import com.jfinal.aop.Interceptor;
import com.jfinal.aop.Invocation;
import com.regan.erp.exception.MyBaselogicException;
import com.regan.erp.util.UserUtil;

/**
 * 用户登录超时拦截器
 *
 * @author zhangby
 * @date 2018/9/12 下午2:55
 */
public class UserLoginInterceptor implements Interceptor {

    @Override
    public void intercept(Invocation inv) {
        //验证用户登录超时
        Boolean logFlag = UserUtil.verify(inv.getController().getSession());
        if (!logFlag) {
            throw new MyBaselogicException("998");
        }
        inv.invoke();
    }
}
